﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SF.Base.Core;

namespace SF.Dict.Web {
	public partial class Publish : BasePage {
		protected void Page_Load(object sender, EventArgs e) {
			string pub = Request.GetStr("pub", "text");

			Logger.Debug(Request["editorcontent"] + "_____");

			if (Global.DTUser == null) {
				Response.Redirect("/login.aspx?return=" + Server.UrlEncode(string.Format("/publish.aspx?pub={0}", pub)));
			}
			
			if (pub == "text") {
				ll_title.Text = "发布文字 | 挚友云海";
				ltl_title.Text = "发布文字";
				pb_text.CssClass = "text";
				tb_title.Visible = false;
				tb_tags.Visible = false;
			}
			else if (pub == "dict") {
				ll_title.Text = "发布单词 | 挚友云海";
				ltl_title.Text = "发布单词";
				pb_text.CssClass = "dict";
				tb_tags.Visible = false;
				ltl_sectiontitle.Text = "单词";
			}
			else if (pub == "examination") {
				ll_title.Text = "发布题目 | 挚友云海";
				ltl_title.Text = "发布题目";
				pb_text.CssClass = "examination";
				tb_title.Visible = false;
				ltl_sectiontags.Text = "考点<span>(考点请用“，”分隔)</span>";
			}
			else if (pub == "article") {
				ll_title.Text = "发布文章 | 挚友云海";
				ltl_title.Text = "发布文章";
				pb_text.CssClass = "article";
				ltl_sectiontitle.Text = "标题<span>(可不填)</span>";
				ltl_sectiontags.Text = "标签<span>(标签请用“，”分隔)</span>";
			}
		}
	}
}